package com.ruoyi.web.service.impl;

import com.alibaba.fastjson.JSON;
import com.ruoyi.common.config.pay.*;
import com.ruoyi.common.enums.ServiceCodeEnum;
import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.web.request.*;
import com.ruoyi.web.response.*;
import com.ruoyi.web.service.AgentPayService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class AgentPayServiceImpl implements AgentPayService {
    public Logger logger = LoggerFactory.getLogger(AgentPayService.class);
    @Autowired
    private SignService signService;
    @Override
    public HashMap<String, Object> IESI123101(IESI123101Request request,String sequenceNo,String merchCd) throws Exception{
        BusinessException.notNull(request.getType(),"类型不能为空");
        //实体转map
        String code=ServiceCodeEnum.IESI123101.getCode();
        Map<String,Object> requestMap = signService.entityToMap(request,merchCd,sequenceNo);
        //请求接口，获得响应参数
        HashMap<String, Object> responseMap= signService.dealXibPost(requestMap,code,merchCd);
        return responseMap;
    }

    @Override
    public  HashMap<String, Object> IESI123102(IESI123102Request request,String sequenceNo,String merchCd) throws Exception{
        //实体转map
        String code=ServiceCodeEnum.IESI123102.getCode();
        Map<String,Object> requestMap = signService.entityToMap(request,merchCd,sequenceNo);
        //请求接口，获得响应参数
        HashMap<String, Object> responseMap= signService.dealXibPost(requestMap,code,merchCd);
        return responseMap;
    }

    @Override
    public  HashMap<String, Object> IESI123103(IESI123103Request request,String sequenceNo,String merchCd) throws Exception{
        BusinessException.notNull(request.getType(),"类型不能为空");
        //实体转map
        String code=ServiceCodeEnum.IESI123103.getCode();
        Map<String,Object> requestMap = signService.entityToMap(request,merchCd,sequenceNo);
        //请求接口，获得响应参数
        HashMap<String, Object> responseMap= signService.dealXibPost(requestMap,code,merchCd);
        return responseMap;
    }

    @Override
    public HashMap<String, Object> IESI123104(IESI123104Request request,String sequenceNo,String merchCd) throws Exception{
        //实体转map
        String code=ServiceCodeEnum.IESI123104.getCode();
        Map<String,Object> requestMap = signService.entityToMap(request,merchCd,sequenceNo);
        //请求接口，获得响应参数
        HashMap<String, Object> responseMap= signService.dealXibPost(requestMap,code,merchCd);
        return responseMap;
    }

    @Override
    public HashMap<String, Object> IESI123105(IESI123105Request request,String sequenceNo,String merchCd) throws Exception{
        //实体转map
        String code=ServiceCodeEnum.IESI123105.getCode();
        Map<String,Object> requestMap = signService.entityToMap(request,merchCd,sequenceNo);
        //请求接口，获得响应参数
        HashMap<String, Object> responseMap= signService.dealXibPost(requestMap,code,merchCd);
        return responseMap;
    }

    @Override
    public HashMap<String, Object> IESI123106(IESI123106Request request,String sequenceNo,String merchCd) throws Exception{
        //实体转map
        String code=ServiceCodeEnum.IESI123106.getCode();
        Map<String,Object> requestMap = signService.entityToMap(request,merchCd,sequenceNo);
        //请求接口，获得响应参数
        HashMap<String, Object> responseMap= signService.dealXibPost(requestMap,code,merchCd);
        return responseMap;
    }

    @Override
    public HashMap<String, Object> IESI123107(IESI123107Request request,String sequenceNo,String merchCd) throws Exception{
        //实体转map
        String code=ServiceCodeEnum.IESI123107.getCode();
        Map<String,Object> requestMap = signService.entityToMap(request,merchCd,sequenceNo);
        //请求接口，获得响应参数
        HashMap<String, Object> responseMap= signService.dealXibPost(requestMap,code,merchCd);
        return responseMap;
    }

    @Override
    public HashMap<String, Object> IESI123108(IESI123108Request request,String sequenceNo,String merchCd) throws Exception{
        //实体转map
        String code=ServiceCodeEnum.IESI123108.getCode();
        Map<String,Object> requestMap = signService.entityToMap(request,merchCd,sequenceNo);
        //请求接口，获得响应参数
        HashMap<String, Object> responseMap= signService.dealXibPost(requestMap,code,merchCd);
        return responseMap;
    }

    @Override
    public HashMap<String, Object> IESI123109(IESI123109Request request,String sequenceNo,String merchCd) throws Exception{
        //实体转map
        String code=ServiceCodeEnum.IESI123109.getCode();
        Map<String,Object> requestMap = signService.entityToMap(request,merchCd,sequenceNo);
        //请求接口，获得响应参数
        HashMap<String, Object> responseMap= signService.dealXibPost(requestMap,code,merchCd);
        return responseMap;
    }
}
